#!/bin/sh
# 等待IPv6网络接通
awaiting_network_connection()
{
	MAX_ATTEMPTS=20
	while [ $MAX_ATTEMPTS -gt 0 ]; do
		if ping6 -c 1 2400:3200::1 || ping6 -c 1 2400:3200:baba::1; then
			break
		else
			sleep 3
			local MAX_ATTEMPTS=$(($MAX_ATTEMPTS-1))
		fi
	done
}
awaiting_network_connection >/dev/null
cd /data/usr/app || exit 1
# 运行ddns-go
./ddns-go -c ./.ddns_go_config.yaml >/dev/null 2>&1 &
